<div class="main_fr_mic" style="margin-bottom:10px;">
          <i class="glyphicon glyphicon-home"></i>
          <a href="admin/index">首页</a><span>></span>
          <a  class="active">系统管理</a><span>></span>
          <a class="active">系统日志</a>
</div>
 
<div id="interfaceList" class="main_fr_down over">
	<div class="main_fr_search over mb10">
		  <form id="search_submit" class="form-inline">
			  <div class="good_top22">
				  <span class="good_top021">条件查询</span>
				  <!-- <span class="good_top022">
				      <input type="button" onclick="search();" class="search_an01 anbg" value="查询">
		              <input type="reset" class="search_an01" value="取消">
				   </span> -->
			  </div>
			  <div class="main_fr_search_cx">
				IP<input name="log.ip" placeholder="请输入ip" type="text" class="srk" style="width:200px;"/>
				操作内容<input name="log.content" placeholder="请输入操作内容" type="text" class="srk" style="width:200px;"/>
				用户名<input name="log.user_name" placeholder="请输入用户名" type="text" class="srk" style="width:200px;"/>
 			  		<input type="button" onclick="search(1);" class="search_an01 anbg" value="查询">
 			  </div>
		  </form>
	</div>
	<div class="sh_search over mb10">
		<div class="over sh_search_table">
			
	<div class="over mb10" style=" position:relative;">
		<div class="good_top22" style="margin-bottom: 0px;">
		  <span class="good_top021">系统日志列表</span>
		  <span class="good_top022">
		   </span>
		 </div>
	</div> 
	</div>
	<table class="table table-bordered table-hover">
		<thead  class="table_heaer">
			<tr class="text-center">
			<th>编号</th>
				<th>用户类型</th>
				<th>用户名</th>
				<th>操作内容</th>
				<th>登录IP</th> 
				<th>操作时间</th>
			</tr>
		</thead>
		<tbody id="projectTable">
		</tbody>
	</table>
	</div>
			<div id="pages" class="text-right"></div>
	</div>
</div>

<!--  弹出层div-->
<div id="addFormDiv" class="hide" style="padding-top:15px;">
	<form class="form-horizontal" id="addForm">f
		<input type="hidden" id="id" name="log.id">
		<div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">过滤关键词</label>
			<div class="col-sm-9">
				<input type="text"  class="form-control" id="name" placeholder="请输入关键词名称" name="log.name" minlength="1"  maxlength="50" required>
			</div>
		</div>
		<div class="form-group">
		<label for="exampleInputEmail2" class="col-sm-2 control-label"></label>
			<div class="col-sm-9">
			<button type="submit" class="btn btn-success">立即提交</button>
			<button type="reset" class="btn btn-default">重置</button>
			</div>
		</div>
		
	</form>
</div>
<!-- 在这里引入本页面需要的js -->
<script>
function userList(data) {
	var dataStr = "";
	$.each(data, function(i, v) {
		if(v.description==null){
			v.description=="";
		}
		dataStr += '<tr>';
		dataStr += '<td>' + v.id + '</td>';
		if(v.role_id==1){
			dataStr += '<td>平台管理员</td>';
		}else if(v.role_id==2){
			dataStr += '<td>讲师</td>';
		}else if(v.role_id==3){
			dataStr += '<td>学员</td>';
		}else{
			dataStr += '<td>其他</td>';
		}
		dataStr += '<td>' + v.user_name + '</td>';
		dataStr += '<td>' + v.content + '</td>';
		dataStr += '<td>' + v.ip + '</td>';
		dataStr += '<td>' + v.create_time + '</td>';
		dataStr += '</tr>';
	});
	$("#projectTable").html(dataStr);
	$("#projectTable .deleteButton").click(function() {
		clickDelete($(this));
		return false;
	})
}
function pageChange(curr) {
	$.get("log/list?curr="+curr, $("#search_submit").serialize(), function(data) {
		userList(data.content.list);
		laypage({
		    cont: $('#pages'), //容器。值支持id名、原生dom对象，jquery对象,
		    pages: data.content.totalPage, //总页数
		    skip: true, //是否开启跳页
		    skin: '#4599e0',
		    curr: data.content.pageNumber,
		    groups: 3, //连续显示分页数
		    jump: function(obj, first) {
		    	if(!first){ //一定要加此判断，否则初始时会无限刷新
		    		pageChange(obj.curr);
		    	}
		    }
		});
	});
}
pageChange(1);
function search(){
	pageChange(1);
}
</script>